﻿<Controls:SinacorWindow
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  mc:Ignorable="d"
  xmlns:Controls="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient;assembly=Sinacor.Infra.UI.Controls"
  xmlns:Validation="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient.Validation;assembly=Sinacor.Infra.UI.Controls"
  xmlns:Edit="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient.Edit;assembly=Sinacor.Infra.UI.Controls"
  x:Class="Sinacor.UI.Bovespa.Ordens.View.SmartClient.CancelamentoDistribuicao"
  Title="{DynamicResource Bovespa.Menu.Label.CancelamentoDistribuicao}"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  ModuleId="ORD"
  ModulePlus="False"
  WindowStartupLocation="CenterScreen"
  WindowState="Maximized"
  >

  <Controls:SinacorExpanderContainer x:Name="CancelamentoDistribuicaoContainer">

    <!--Definição de linhas no Container-->
    <Controls:SinacorExpanderContainer.RowDefinitions>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="*"/>
    </Controls:SinacorExpanderContainer.RowDefinitions>

    <!--Filtros de Pesquisa-->
        <Controls:SinacorExpander x:Name="ExpanderPesquisa" Grid.Row="0" Header="{DynamicResource Bovespa.Ordens.Label.Pesquisa}" AllowExpand="True" IsExpanded="True">
            <Grid>
                <Controls:SinacorLabel x:Name="LblApelido"  Content="{DynamicResource Bovespa.Ordens.Label.Apelido}" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Width="60" HorizontalContentAlignment="Right"  />
                <Controls:SinacorTextBox x:Name="TxtApelido" Text="" HorizontalAlignment="Left" Width="100" Margin="64,0,0,0" VerticalAlignment="Top" MaxLength="18"  TextLength="18" KeyUp="TxtApelido_KeyUp" TabIndex="1" RequiredErrorMessage="Bovespa.Clientes.Message.ClienteObrigatorio" />

                <Controls:SinacorButton x:Name="BtnPesquisaCliente" Visibility="Visible"  Icon="IconButtonClient" TabIndex="2" Margin="168,0,0,0" VerticalAlignment="Top" ToolTip="{DynamicResource Bovespa.Ordens.Tooltip.PesquisarCliente}" Click="BtnPesquisaCliente_Click" Height="21.276" HorizontalAlignment="Left" Width="23" />
                <Controls:SinacorLabel x:Name="LblNomeCliente"  Content="{DynamicResource Bovespa.Ordens.Label.Cliente}" Margin="210,0,0,0" Width="45" HorizontalAlignment="Left" VerticalAlignment="Top" HorizontalContentAlignment="Right" Height="19" />

                <Controls:SinacorTextBox x:Name="TxtCliente" Text="" Margin="260,0,0,0" VerticalAlignment="Top" IsEnabled="False" Height="19.277" HorizontalAlignment="Left" Width="250" />
                <Controls:SinacorLabel x:Name="LblPregao"  Content="{DynamicResource Bovespa.Ordens.Label.Pregao}" Margin="500,0,0,0" Width="100" VerticalAlignment="Top" HorizontalContentAlignment="Right" HorizontalAlignment="Left" />
                <Controls:SinacorComboBox HorizontalAlignment="Left" VerticalAlignment="Top" IsSynchronizedWithCurrentItem="True" Margin="604,0,0,0" Width="150" x:Name="CmbPregao"  IsRequired="True"  DisplayMemberPath="DataPregaoShortDateString" SelectedValuePath="DataPregao"  ItemsSource="{Binding CancelamentoDistribuicaoPresenter.ListCalendario, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:SinacorWindow}}}" TabIndex="3" />
                <Controls:SinacorGroupBox HorizontalAlignment="Left" VerticalAlignment="Top" Header="{DynamicResource Bovespa.Ordens.Label.Filhote}" Margin="0,25,0,0" Width="548" Height="51">
                    <Grid>
                        <Controls:SinacorTextBox MaxLength="18"  TextLength="18"  HorizontalAlignment="Left" VerticalAlignment="Top" Width="200" Name="TxtFilhote" KeyUp="TxtFilhote_KeyUp" LostFocus="TxtFilhote_LostFocus" TabIndex="4"/>
                        <Controls:SinacorButton x:Name="BtnPesquisaFilhotes" Visibility="Visible"  Icon="IconButtonClients"  Width="25" Margin="204,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Stretch" ToolTip="{DynamicResource Bovespa.Ordens.Tooltip.PesquisarFilhotes}" Click="BtnPesquisaFilhotes_Click" TabIndex="5" />
                        <Controls:SinacorCheckBox VerticalAlignment="Top" HorizontalAlignment="Left" Name="ChkExcluirFilhote" Content="{DynamicResource Bovespa.Ordens.Label.ExcluirFilhoteIndicado}" Margin="233,0,0,0" Width="290" IsEnabled="False" TabIndex="6"/>
                    </Grid>
                </Controls:SinacorGroupBox>
                <Controls:SinacorLabel  Content="{DynamicResource Bovespa.Ordens.Label.Operador}" Margin="552,52,0,0" Width="70" VerticalAlignment="Top" HorizontalContentAlignment="Right" x:Name="labelOperador" HorizontalAlignment="Left" />
                <Controls:SinacorComboBox HorizontalAlignment="Left" VerticalAlignment="Top" IsSynchronizedWithCurrentItem="True" TabIndex="7" Margin="626,52,0,0" Width="128" x:Name="CmbOperador" DisplayMemberPath="LoginOperador" SelectedValuePath="LoginOperador"  ItemsSource="{Binding CancelamentoDistribuicaoPresenter.ListOperador, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:SinacorWindow}}}"  />
                <Controls:SinacorButton HorizontalAlignment="Left" VerticalAlignment="Top" Content="{DynamicResource Bovespa.Ordens.Label.Pesquisar}" Margin="758,52,0,0" Width="80" x:Name="BtnPesquisarOrdens" Click="BtnPesquisarOrdens_Click" TabIndex="8" IsDefault="True" />

                <Controls:SinacorButton x:Name="buttonNovaBusca" HorizontalAlignment="Left" VerticalAlignment="Top" Click="btnNovaBusca_Click"  Margin="842,52,0,0" Content="{DynamicResource Bovespa.Ordens.Label.NovaPesquisa}" Width="106" TabIndex="9" />
            </Grid>
        </Controls:SinacorExpander>

        <!--Grid de Distribuição de Ordens-->
    <Controls:SinacorExpander x:Name="ExpanderDistribuicaoDataGrid" Grid.Row="1" Header="{DynamicResource Bovespa.Ordens.Label.DistribuicaoOrdemLote}" HorizontalSplitter="{Binding ElementName=hSplitNegocio}" Margin="0,4,0,0" AllowExpand="False" IsExpanded="True" >
    <Grid>

        <Grid.RowDefinitions>
          <RowDefinition Height="*" />
          <RowDefinition Height="25" />
        </Grid.RowDefinitions>

        <Controls:SinacorDataGrid Grid.Row="0" 
                                  AllowDelete="False" 
                                  AllowPanelUpdate="False" 
                                  AllowPanelInsert="False" 
                                  AllowBeginInsert="False" 
                                  AllowBeginUpdate="False" 
                                  x:Name="datagridDistribuicao" 
                                  ItemsSource="{Binding CancelamentoDistribuicaoPresenter.ListOrdem, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:SinacorWindow}}}" 
                                  ApplyingStyle="datagridDistribuicao_ApplyingStyle"
                                  SelectionMode="Extended">

          <!--Menu de Contexto-->
          <Controls:SinacorDataGrid.ContextMenuTemplate>
            <DataTemplate>
              <StackPanel>
                <Controls:SinacorContextMenuItem Header="{DynamicResource Bovespa.Ordens.Label.CancelarDistribuicao}" Click="SinacorContextMenuItem_Click" CommandTarget="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:SinacorDataGrid}}}"  IsEnabled="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:SinacorWindow}}, Path=IsEnableCancel}" />
              </StackPanel>
            </DataTemplate>
          </Controls:SinacorDataGrid.ContextMenuTemplate>

          <!--Colunas-->
          <Controls:SinacorDataGrid.Columns>
            <Controls:Column Name="Ativo" Title="Bovespa.Ordens.Label.AtivoCancelamento" DisplayMemberPath="Titulo" MaxLength="12" />
            <Controls:Column Name="Bolsa" Title="Bovespa.Ordens.Label.Bolsa" DisplayMemberPath="Bolsa" MaxLength="2"  />
            <Controls:Column Name="Broker" Title="Bovespa.Ordens.Label.BrokerCancelamento" DisplayMemberPath="CodigoBroker"  MaxLength="18"  />
            <Controls:Column Name="Cliente" Title="Bovespa.Ordens.Label.ClienteCancelamento" DisplayMemberPath="ApelidoCliente"  MaxLength="18"  />
            <Controls:Column Name="DataOrdem" Title="Bovespa.Ordens.Label.DataOrdem" DisplayMemberPath="DataOrdem"  />
            <Controls:Column Name="Mercado" Title="Bovespa.Ordens.Label.Mercado" DisplayMemberPath="TipoMercado"  MaxLength="3" />
            <Controls:Column Name="NaturezaOperacao" Title="Bovespa.Ordens.Label.NaturezaOperacao" DisplayMemberPath="NaturezaOperacao" MaxLength="1" />
            <Controls:Column Name="NumeroOrdem" Title="Bovespa.Ordens.Label.NumOrdCancelamento" DisplayMemberPath="NumeroOrdem" Integers="9" HorizontalCellAlignment="Right"  />
            <Controls:Column Name="NumeroNegocio" Title="Bovespa.Ordens.Label.NumNegocio" DisplayMemberPath="NumeroNegocio" Integers="9" HorizontalCellAlignment="Right"  />
            <Controls:Column Name="NumeroLote" Title="Bovespa.Ordens.Label.NumLote" DisplayMemberPath="NumeroConjunto" Integers="9" HorizontalCellAlignment="Right"  />
            <Controls:Column Name="Operador" Title="Bovespa.Ordens.Label.NomeOperador" DisplayMemberPath="LoginOperador" MaxLength="20" />
            <Controls:Column Name="OrdemOriginal" Title="Bovespa.Ordens.Label.OrdemOriginal" DisplayMemberPath="NumeroOrdemOriginal" Integers="9" HorizontalCellAlignment="Right"  />
            <Controls:Column Name="PercDistribuido" Title="Bovespa.Ordens.Label.PercentualDistribuido" DisplayMemberPath="PercentualDistribuido" Decimals="8" Integers="12" StringFormat="n8"  HorizontalCellAlignment="Right" />
            <Controls:Column Name="Quantidade" Title="Bovespa.Ordens.Label.Quantidade" DisplayMemberPath="Quantidade"  Decimals="4" Integers="16" StringFormat="n4"  HorizontalCellAlignment="Right"  />
            <Controls:Column Name="QtdCasada" Title="Bovespa.Ordens.Label.QtdCasada" DisplayMemberPath="QuantidadeCasada"  Decimals="4" Integers="16" StringFormat="n4"  HorizontalCellAlignment="Right"  />
            <Controls:Column Name="QtdDistribuida" Title="Bovespa.Ordens.Label.QtdDistribuida" DisplayMemberPath="QuantidadeDistribuida"  Decimals="4" Integers="16" StringFormat="n4"  HorizontalCellAlignment="Right"  />
            <Controls:Column Name="SubseqOrdem" Title="Bovespa.Ordens.Label.Subsequencia" DisplayMemberPath="NumeroOrdemSubSequencia" Integers="5" HorizontalCellAlignment="Right"  />
          </Controls:SinacorDataGrid.Columns>

        </Controls:SinacorDataGrid>

        <!--Legendas-->
        <StackPanel Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Left" Orientation="Horizontal" DockPanel.Dock="Left" Margin="0,4,0,0">
          <Controls:SinacorLabel Content="{DynamicResource Bovespa.Clientes.Label.Legenda}" x:Name="txtLegenda" HorizontalAlignment="Left" VerticalAlignment="Top" HorizontalContentAlignment="Left" Margin="0,0,0,0"/>
          <Ellipse Fill="{DynamicResource BrushGridRowBusiness04}" Width="15" Height="15" StrokeThickness="0" Margin="0,0,0,0"/>
          <Controls:SinacorLabel Content="{DynamicResource Bovespa.Ordens.Label.Parcialmente}" x:Name="txtBlSinalizacaoInativo"  HorizontalAlignment="Left" VerticalAlignment="Top" HorizontalContentAlignment="Left" Margin="0,0,0,0" Width="150"/>
          <Ellipse Fill="{DynamicResource BrushGridRowBusiness02}" Stroke="#FF000000" StrokeThickness="0" Width="15" Height="15" Margin="0,0,0,0"/>
          <Controls:SinacorLabel Content="{DynamicResource Bovespa.Ordens.Label.Distribuida}" x:Name="TXTbLSinalizacaoAtivo" HorizontalAlignment="Left" VerticalAlignment="Top" HorizontalContentAlignment="Left" Margin="0,0,0,0" />
        </StackPanel>

      </Grid>
    </Controls:SinacorExpander>

  </Controls:SinacorExpanderContainer>

</Controls:SinacorWindow>
